<nz-tabset *ngIf="option.selections" [nzTabBarGutter]="12" [nzTabBarStyle]="{'letter-spacing':'2px','margin':'0','padding':'0 24px'}">
    <nz-tab *ngFor="let opt of option.selections;" [nzTitle]="opt.text" (nzClick)="selectChange(opt.value)"></nz-tab>
</nz-tabset>

<nz-table #nzTable [nzData]="data" [nzTotal]="page.total" [nzPageIndex]="page.pageIndex" [nzPageSize]="page.size"
    [nzShowPagination]="(page&&page.total>1)?true:false" [nzLoading]="loading" [nzPageSizeOptions]="pageSizeOption"
    [nzShowQuickJumper]="option.table.isComplexPage?option.table.isComplexPage:false"
    [nzShowSizeChanger]="option.table.isComplexPage?option.table.isComplexPage:false"
    [nzFrontPagination]="false"
    (nzPageIndexChange)="indexChange($event)" (nzPageSizeChange)="pageSizeChange($event)">

    <thead>
        <tr class="thead">
            <th *ngFor="let col of option.table.columns;" [nzWidth]="col.width?col.width+'px':null">{{ col.title }}</th>
            <th *ngIf="option.table.op"
                [nzWidth]="option.table.op?(option.table.op.width?option.table.op.width+'px':null):null">操作</th>
        </tr>
    </thead>

    <tbody>

        <tr *ngFor="let item of nzTable.data;let itemIndex=index">

            <td *ngFor="let col of option.table.columns;let colIndex = index">
                <ngs-table-column [colOption]="col" [item]="item">{{item.address}}</ngs-table-column>
            </td>

            <td *ngIf="option.table.op">

                <span *ngFor="let btn of option.table.op.buttons;let btnIndex = index">
                    <nz-divider *ngIf="btnIndex > 0 && (btn.hidden?btn.hidden(item):true)" nzType="vertical"></nz-divider>
                    <a nz-button nzType="link" *ngIf="btn.hidden?btn.hidden(item):true" (click)="btnClick(btn,item)">{{ getBtnText(btn,item) }}</a>
                </span>

                <span *ngFor="let groupBtn of option.table.op.groupButtons;let groupIndex = index">
                    
                    <nz-divider nzType="vertical"></nz-divider>
                    <a nz-dropdown [nzDropdownMenu]="menu" *ngIf="groupBtn.hidden?groupBtn.hidden(item):true">
                        {{ groupBtn.text }}
                        <i nz-icon nzType="down"></i>
                    </a>

                    <nz-dropdown-menu #menu="nzDropdownMenu">
                        <ul nz-menu nzSelectable>
                            <ng-template ngFor let-itm [ngForOf]="groupBtn.buttons" let-i="index">
                                <li nz-menu-item *ngIf="itm.hidden?itm.hidden(item):true" (click)="btnClick(itm,item)">
                                    {{ getBtnText(itm,item) }}
                                </li>
                            </ng-template>
                        </ul>
                    </nz-dropdown-menu>
                </span>

            </td>
            
        </tr>
    </tbody>

</nz-table>